module TowerBarrelP {
	provides interface Init;
	provides interface DoForSomeTime as BarrelUpDown;

	uses interface GeneralIO as BarrelPin;
	uses interface Timer<TMilli>;
}

implementation {

	command error_t Init.init() {
		call BarrelPin.clr();		
		call BarrelPin.makeOutput();
		return SUCCESS;
	}
	
	command void BarrelUpDown.doit(uint16_t time) {
		call Timer.startOneShot(time);
		call BarrelPin.set();		
	}

	event void Timer.fired() {
		call BarrelPin.clr();		
	}
}
